home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Games Collection 1 / software vault.zip / software vault / CDR02 / DCGAMES1.ZIP / NEWGAME.ZIP / HEALER.SCR < prev    next >
Text File  |  1993-04-01  |  5KB  |  194 lines

  1. !
  2. ! Default Healer's Script
  3. !
  4. ! (c) DC Software, 1992
  5. !
  6.  
  7. !------------------------------------------------------------------------!
  8. :@TALK ! Talk to the character !
  9. !------------------------------------------------------------------------!
  10.  
  11. ! First, say hello.. !
  12.   if NPC.V0 > 0 then
  13.     writeln( "Hello ", player.name, ". What brings you back?" );
  14.   else
  15.     writeln( "Welcome to ", npc.name, ". How may I help you?" );
  16.   endif;
  17.  
  18. ! Now, set some variables..
  19.   NPC.V0 = 1; ! From know on, remember we've been here
  20.  
  21.   L0 = group.current;        ! Current spokesperson !
  22.   L4 = npc.value;            ! Cost of healing !
  23.   L5 = npc.value * 2;        ! Cost of Cures !
  24.   L6 = npc.value * 5;        ! Cost of resurections !
  25.   L7 = npc.value / 2 + 1;    ! Cost of removing cursed items !
  26.  
  27. :LOOP
  28.   group.current = L0;
  29.   L3 = select$( "Heal",          L4,
  30.                 "Cure",          L5,
  31.                 "Resurrect",     L6,
  32.                 "Remove Curse",  L7,
  33.                 "Talk",          -1  ! (talking is free)
  34.                );
  35.  
  36.   ON L3 GOTO DO_HEAL, DO_CURE, DO_RESTORE, CURSE, CHAT;
  37.  
  38. :CSTOP
  39.   writeln( "'Till we meet again.." );
  40.   STOP;
  41.  
  42. !
  43. ! Heal Wounds..
  44. !
  45. :DO_HEAL
  46.   writeln( "Heal who?" );
  47.   L3 = select( group );
  48.   IF L3 < 0 GOTO LOOP;
  49.  
  50.   if player.hp >= player.mhp then
  51.     writeln( player.name, " is not hurt.  You waste my time." );
  52.     goto LOOP;
  53.   endif;
  54.  
  55.   if player.hp = 0   GOTO DEADGUY;
  56.   if group.gold < L4 GOTO NOMONEY;
  57.  
  58.   writeln( player.name, " is now healed." );
  59.   voice( "OkSpell", 1000 );
  60.   dec( group.gold, L4 );
  61.   player.hp = player.mhp;  ! Reset the hit points to maximum hit points !
  62.   goto LOOP;
  63.  
  64.  
  65. !
  66. ! Cure poisoning...
  67. !
  68. :DO_CURE
  69.   writeln( "Cure whom?" );
  70.   L3 = select( group );
  71.   IF L3 < 0 GOTO LOOP;
  72.  
  73.   if player.hp = 0           GOTO DEADGUY;
  74.  
  75.   if NOT player.poisoned then
  76.     writeln( player.name, " is not poisoned.  You waste my time." );
  77.     goto LOOP;
  78.   endif;
  79.  
  80.   if group.gold < L5         GOTO NOMONEY;
  81.  
  82.   writeln( player.name, " is now cured." );
  83.   voice( "OkSpell", 1000 );
  84.   dec( group.gold, L5 );
  85.   player.poisoned = 0;
  86.   goto LOOP;
  87.  
  88. !
  89. ! Remove Cursed Item..
  90. !
  91. :CURSE
  92.   writeln( "Who has the cursed item?" );
  93.   L3 = select( group );
  94.   IF L3 < 0 GOTO LOOP;
  95.  
  96.   writeln( "Remove what item?" );
  97.   L3 = select( player.body );
  98.   if L3 < 0 goto LOOP;
  99.  
  100.   if curritem.cursed then
  101.     if group.gold <  L6 GOTO NOMONEY;
  102.     dec( group.gold, L6 );
  103.     writeln( "The ", curritem.type, " has been removed." );
  104.     voice( "OkSpell", 1000 );
  105.     move( curritem, player );
  106.   else
  107.     writeln( "The ", curritem.name, " is not cursed." );
  108.   endif;
  109.  
  110.   goto LOOP;
  111. !
  112. ! or, if you so wish, you can handle each type separately..
  113. !
  114. !  on L3 goto :Weapon, :Armor, :Shield, :Ring, :Amulet, :Staff;
  115. !  goto LOOP;
  116. !  :Weapon move( player.weapon, player ); goto LOOP;
  117. !  :Armor  move( player.armor , player ); goto LOOP;
  118. !  :Shield move( player.shield, player ); goto LOOP;
  119. !  :Ring   move( player.ring  , player ); goto LOOP;
  120. !  :Amulet move( player.amulet, player ); goto LOOP;
  121. !  :Staff  move( player.staff , player ); goto LOOP;
  122.  
  123. !
  124. ! Resurect the dead..
  125. !
  126. :DO_RESTORE
  127.   writeln( "Resurrect who?" );
  128.   L3 = select( group );
  129.   IF L3 < 0 GOTO LOOP;
  130.  
  131.   if player.hp <> 0 then
  132.     writeln( player.name, " is not dead.  You waste my time." );
  133.     goto LOOP;
  134.   endif;
  135.  
  136.   if group.gold < L7 GOTO NOMONEY;
  137.  
  138.   voice( "HighWind", 1000 );
  139.   writeln( "First, the healer treats the dead body of ", player.name );
  140.   writeln( "treating every wound.  Then he replaces the blood in the body" );
  141.   writeln( "with a clear substance.  Finally a resurrection spell brings" );
  142.   writeln( "your friend to life." );
  143.   voice( "Thunder", 1000 );
  144.   voice( "WakeCall", 1000 );
  145.  
  146.   player.poisoned = 0;
  147.   player.hp       = player.mhp;
  148.   dec( group.gold, L7 );
  149.   goto LOOP;
  150.  
  151. :DEADGUY
  152.   voice( "Dead" );
  153.   writeln( "Dr McCoy: He's dead Jim.." );
  154.   goto LOOP;
  155.  
  156. :NOMONEY
  157.   voice( "Broke" );
  158.   writeln( "Sorry, you can't afford it." );
  159.   goto LOOP;
  160.  
  161. !
  162. ! Handle conversation..
  163. !
  164. :CHAT
  165.   writeln( "What would you like to talk about?" );
  166.  
  167. :CHAT1
  168.   L3 = getstr("Name","Heal","Cure","Resurrec","Remove","Curse","Join","Bye");
  169.   if L3 = -1 then 
  170.     writeln( "Ok." );
  171.     goto LOOP; ! Pressed ESCape !
  172.   endif;
  173.  
  174. ! First, see if the keyword typed is in the character's text block !
  175.   if dotext( S0 ) goto CHAT1;
  176.  
  177. ! It didn't, so try the predefined ones..
  178.   on L3 goto CName, DO_HEAL, DO_CURE, DO_RESTORE, CURSE, CURSE, JOINP, CSTOP;
  179.  
  180. ! Nope, try a 'DEFAULT' line
  181.   if not dotext( "DEFAULT" ) then
  182.     writeln( "I don't know anything about that!" );
  183.   endif;
  184.   goto CHAT1;
  185.  
  186. :CName
  187.   writeln( "My name is ", npc.name, "."        );
  188.   goto CHAT1;
  189.  
  190. :JOINP
  191.   writeln( "Sorry.  I'm dedicated to my patients.." );
  192.   goto CHAT1;
  193.  
  194.